home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: Feb. 6, 1997
- // Author: DSW
- //
- // Description:
- // Project Create/Setup window.
- //
- // Input Arguments:
- // None
- //
- // Return Value:
- // None
- //
-
- proc string[] np_getObjectWidgets(string $wsName)
- {
- string $defaults[] =
- {
- // Label Widget Default Current
- "Scenes", "scene", "scenes", ""
- };
-
- if ($wsName != "")
- {
- string $ot[] = `workspace -q -ot $wsName`;
-
- int $i, $j;
- int $found;
-
- for ($i = 0; $i < size($ot); $i += 2)
- {
- $found = 0;
-
- for ($j = 0; $j < size($defaults); $j += 4)
- {
- if ($ot[$i] == $defaults[$j + 1])
- {
- $defaults[$j + 3] = $ot[$i + 1];
- $found = 1;
- break;
- }
- }
-
- if (!$found)
- {
- // No, this is not a cut and paste error. This line
- // should b repeated 4 times.
- //
- $defaults[size($defaults)] = $ot[$i];
- $defaults[size($defaults)] = $ot[$i];
- $defaults[size($defaults)] = $ot[$i];
- $defaults[size($defaults)] = `workspace -ote $ot[$i] $wsName`;
- }
- }
- }
-
- return $defaults;
- }
-
- proc string[] np_getRenderWidgets(string $wsName)
- {
- string $defaults[] =
- {
- // Label Widget Default Current
- "Images", "images", "images", "",
- "Source Images","sourceImages", "sourceimages", "",
- "Clips", "clips", "clips", "",
- "Sound", "audio", "sound", "",
- "Particles", "particles", "particles", "",
- "Render Scenes","renderScenes", "renderScenes", "",
- "Depth", "depth", "renderData/depth", "",
- "IPR Images", "iprImages", "renderData/iprImages", "",
- // This naming admittedly doesn't make much sense - textures should be
- // shaders, lights should be lights. Since 3dPaint is now using
- // textures we're going to point both lights and (hypershade-
- // exported) shaders into the 'lights' location (and add a separate
- // 'shaders' location later...)
- "Shaders", "lights", "renderData/shaders", "",
- "Textures", "textures", "textures", "",
- "Mel", "mel", "", "",
- "3dPaintTextures", "3dPaintTextures", "3dPaintTextures", ""
- };
-
- if ($wsName != "")
- {
- string $rt[] = `workspace -q -rt $wsName`;
-
- int $i, $j;
- int $found;
-
- for ($i = 0; $i < size($rt); $i += 2)
- {
- $found = 0;
-
- for ($j = 0; $j < size($defaults); $j += 4)
- {
- if ($rt[$i] == $defaults[$j + 1])
- {
- $defaults[$j + 3] = $rt[$i + 1];
- $found = 1;
- break;
- }
- }
-
- if (!$found)
- {
- // No, this is not a cut and paste error. This line
- // should be repeated 3 times.
- //
- $defaults[size($defaults)] = $rt[$i];
- $defaults[size($defaults)] = $rt[$i];
- $defaults[size($defaults)] = $rt[$i];
- $defaults[size($defaults)] = `workspace -rte $rt[$i] $wsName`;
- }
- }
- }
-
- return $defaults;
- }
-
- proc string[] np_getTranslatorWidgetMap()
- {
- string $map[] =
- {
- // Translator Widget
- "DXF", "dxf",
- "DXFexport", "dxf",
- "IGES", "iges",
- "IGESexport", "iges",
- "OBJ", "obj",
- "OBJexport", "obj",
- "RIB", "rib",
- "RIBexport", "rib",
- "aliasWire", "wire",
- "animImport", "anim",
- "animExport", "anim",
- "EPS", "eps",
- "Illustrator", "illustrator",
- "diskCache", "diskCache"
- };
-
- return $map;
- }
-
- proc string[] np_getFileRuleWidgets(string $wsName)
- {
- // These lines should be visible always
- //
- string $defaults[] =
- {
- // Label Widget Default Current
- "Image", "image", "images", "",
- "DXF", "dxf", "data", "",
- "IGES", "iges", "data", "",
- "OBJ", "obj", "data", "",
- "RIB", "rib", "data", "",
- "Wire", "wire", "data", "",
- "Move", "move", "data", "",
- "Anim", "anim", "data", "",
- "EPS", "eps", "data", "",
- "Illustrator", "illustrator", "data", "",
- "Disk Cache", "diskCache", "data", ""
- };
-
- // This is a list of translators to completely ignore
- //
- string $ignore[] =
- {
- "mayaAscii",
- "mayaBinary",
- "mayaPLE",
- "directory",
- "plug-in",
- // The following are either old translator names or
- // were introduced in error during development. They
- // should be cleaned up.
- //
- "dxf", // should be DXF
- "iges", // should be IGES
- "aiff", // should be audio
- "images", // should be image
- "audio" // It's handled in Project data
- };
-
- int $i, $j;
- int $found, $skip;
- string $map[] = np_getTranslatorWidgetMap();
- string $widget;
-
- string $trans[] = `translator -q -l`;
-
- // If we have a workspace, add the current file rules
- //
- if ($wsName != "")
- {
- string $rules[] = `workspace -q -frl`;
-
- for ($i = 0; $i < size($rules); ++$i)
- {
- $trans[size($trans)] = $rules[$i];
- }
- }
-
- for ($i = 0; $i < size($trans); ++$i)
- {
- $widget = $trans[$i];
-
- $skip = 0;
- // See if this translator should be ignored
- for ($j = 0; $j < size($ignore); ++$j)
- {
- if ($widget == $ignore[$j])
- {
- $skip = 1;
- break;
- }
- }
-
- if ($skip)
- {
- continue;
- }
-
- // Map the translator name to a widget
- //
- for ($j = 0; $j < size($map); $j += 2)
- {
- if ($widget == $map[$j])
- {
- $widget = $map[$j + 1];
- break;
- }
- }
-
- // See if the translator is already in the list so we
- // don't add it twice.
- //
- for ($j = 0; $j < size($defaults); $j += 4)
- {
- if ($widget == $defaults[$j + 1])
- {
- // Yep, we've seen this one already
- if ($wsName != "")
- {
- $defaults[$j + 3] = `workspace -q -fre $trans[$i]`;
- }
- $skip = 1;
- break;
- }
- }
-
- if ($skip)
- {
- continue;
- }
-
- string $defaultLocation = $widget;
- if ( gmatch( $trans[$i], "fur*" ) )
- {
- $defaultLocation = "fur/" + $widget;
- }
-
- // Having made it this far, add it to the list of widgets
- //
- $defaults[size($defaults)] = $trans[$i];
- $defaults[size($defaults)] = $widget;
- $defaults[size($defaults)] = $defaultLocation;
- if ($wsName == "")
- {
- $defaults[size($defaults)] = "";
- }
- else
- {
- $defaults[size($defaults)] = `workspace -q -fre $trans[$i]`;
- }
- }
-
- return $defaults;
- }
-
- global proc np_resetDefaults ( )
- //
- // Description:
- // Fill in the project defaults.
- //
- {
- string $objectWidgets[] = np_getObjectWidgets("");
- string $renderWidgets[] = np_getRenderWidgets("");
- string $fileRuleWidgets[] = np_getFileRuleWidgets("");
-
- int $listSize;
- int $index;
-
- $listSize = size($objectWidgets);
-
- for ($index = 0; $index < $listSize; $index += 4)
- {
- string $name = "np_ObjectLocation" + $objectWidgets[$index + 1];
- string $value = $objectWidgets[$index + 2];
-
- textFieldGrp -e -fileName $value $name;
- }
-
- $listSize = size($renderWidgets);
-
- for ($index = 0; $index < $listSize; $index += 4)
- {
- string $name = "np_RenderLocation" + $renderWidgets[$index + 1];
- string $value = $renderWidgets[$index + 2];
-
- textFieldGrp -e -fileName $value $name;
- }
-
- $listSize = size($fileRuleWidgets);
-
- for ($index = 0; $index < $listSize; $index += 4)
- {
- string $name = "np_FileLocation" + $fileRuleWidgets[$index + 1];
- string $value = $fileRuleWidgets[$index + 2];
-
- textFieldGrp -e -fileName $value $name;
- }
- }
-
-
- global proc int np_createNewProjectCallback ( )
- //
- // Description:
- // Create a new workspace and generate all of the
- // sub directories under it using the user defined defaults.
- //
- // Returns true if the project was created OK.
- // false otherwise.
- //
- // Notes:
- // This has the side effect of setting the workspace to the
- // newly created workspace.
- //
- {
- string $pathSep = ":";
- if (`about -nt`) {
- $pathSep = ";";
- }
-
- string $shortWSName;
- string $wsLocation;
- string $wsRootDir;
- string $project;
-
- $shortWSName = `textFieldGrp -q -text ("np_wsName0")`;
- $wsLocation = `textFieldGrp -q -fileName ("wsLocation0")`;
- // $wsRootDir = `textFieldGrp -q -fileName ("wsRootDir0")`;
-
- int $locationSize = size($wsLocation);
- if ($shortWSName == "") {
- confirmDialog -m ("No Project Name Given")
- -b "OK" -db "OK" -parent newProjectWindow;
- return false;
- }
- if ($locationSize <= 0) {
- confirmDialog -m ("No Project Location Given")
- -b "OK" -db "OK" -parent newProjectWindow;
- return false;
- }
-
- if (match("/$", $wsLocation) != "/") {
- $project = $wsLocation + "/" + $shortWSName;
- } else {
- $project = $wsLocation + $shortWSName;
- }
-
- // Verify that it doesn't exist.
- if (`file -q -ex ($project + "/workspace.mel")`) {
- // Then the project exists.
- confirmDialog -m ($project+" Exists")
- -b "OK" -db "OK" -parent newProjectWindow;
- return false;
- }
-
- workspace -cr $project;
-
- if (!(`file -q -ex $project`)) {
- confirmDialog -m ("Failed to Create "+$project)
- -b "OK" -db "OK" -parent newProjectWindow;
- return false;
- }
-
- // Open the project
- //
- workspace -o $project;
-
- // Call the edit callback to set all the values and create
- // necessary directories
- //
- np_editProjectCallback();
-
- // Reset the prefs for the browser with project specific stuff.
- //
- np_resetBrowserPrefs;
-
- addRecentProject( $project );
-
- return true;
- }
-
- global proc int np_editProjectCallback ( )
- //
- // Description:
- // Update the project setup using the user supplied information.
- //
- // Note:
- // Old directories won't be removed because of the update however
- // they may become unused.
- //
- {
- global string $gProjectSetupWorkspace;
-
- string $pathSep = ":";
- if (`about -nt`) {
- $pathSep = ";";
- }
-
- // Make sure we go to the project root directory before
- // creating any new directories.
- //
- string $origDir = `workspace -q -dir`;
- workspace -dir `workspace -q -rd`;
-
- string $objectWidgets[];
- string $renderWidgets[];
- string $fileRuleWidgets[];
-
- string $fileRuleMap[];
-
- $objectWidgets = np_getObjectWidgets($gProjectSetupWorkspace);
- $renderWidgets = np_getRenderWidgets($gProjectSetupWorkspace);
- $fileRuleWidgets = np_getFileRuleWidgets($gProjectSetupWorkspace);
-
- $fileRuleMap = np_getTranslatorWidgetMap();
-
- int $index;
- int $listSize;
- string $locations[];
-
- $listSize = size($objectWidgets);
-
- for ($index = 0; $index < $listSize; $index += 4)
- {
- string $objtype = $objectWidgets[$index + 1];
- string $name = "np_ObjectLocation" + $objtype;
- string $value;
-
- $value = `textFieldGrp -q -fileName $name`;
- workspace -ot $objtype $value;
-
- if ($value != "")
- {
- if (tokenize($value, $pathSep, $locations) > 0)
- {
- workspace -cr $locations[0];
- }
- }
- }
-
- $listSize = size($renderWidgets);
-
- for ($index = 0; $index < $listSize; $index += 4)
- {
- string $rentype = $renderWidgets[$index + 1];
- string $name = "np_RenderLocation" + $rentype;
- string $value;
-
- $value = `textFieldGrp -q -fileName $name`;
- workspace -rt $rentype $value;
-
- if ($value != "")
- {
- if (tokenize($value, $pathSep, $locations) > 0)
- {
- workspace -cr $locations[0];
- }
- }
- }
-
- $listSize = size($fileRuleWidgets);
-
- for ($index = 0; $index < $listSize; $index += 4)
- {
- string $frtype = $fileRuleWidgets[$index + 1];
- string $name = "np_FileLocation" + $frtype;
- string $value;
- int $j, $found;
-
- $value = `textFieldGrp -q -fileName $name`;
-
- $found = 0;
- for ($j = 0; $j < size($fileRuleMap); $j += 2)
- {
- if ($frtype == $fileRuleMap[$j + 1])
- {
- $found = 1;
- workspace -fr $fileRuleMap[$j] $value;
- }
- }
-
- if (!$found)
- {
- workspace -fr $frtype $value;
- }
-
- if ($value != "")
- {
- if (tokenize($value, $pathSep, $locations) > 0)
- {
- workspace -cr $locations[0];
- }
- }
- }
-
- workspace -u;
- workspace -s;
-
- // Restore the original directory
- //
- workspace -dir $origDir;
-
- // If the browser is up then we must reset it.
- //
-
- if (`window -ex projectViewerWindow`) {
- pv_resetWorkspace; // Force the layout to be redone.
- }
-
- return true;
- }
-
- proc np_showSetup ( string $wsFullName, string $parent, int $bUseDefaults, int $bEditable )
- //
- // Description:
- // Display the setup information for either the specified workspace
- // or the preference defaults.
- //
- // Parameters:
- // $wsFullName - the full name of the workspace.
- // $parent - the parent controlLayout.
- // $bUseDefaults - Fill with defaults.
- // $bEditable - if true then make the fields editable.
- //
- {
- string $np_wsRuleList = ("np_wsRuleList");
- string $itemList[];
- int $listSize;
- int $listSize2;
- int $index;
- int $index2;
- string $curTypeRules[];
- string $curObjectRules[];
- string $curRenderRules[];
- string $tmpString; // Multi use string.
- int $bFound;
- string $curLocation;
- int $justFill;
- string $tfgName;
- int $useWorkspace = $wsFullName != "";
-
- string $objectWidgets[] = np_getObjectWidgets($wsFullName);
- string $renderWidgets[] = np_getRenderWidgets($wsFullName);
- string $fileRuleWidgets[] = np_getFileRuleWidgets($wsFullName);
-
- if (`columnLayout -ex $np_wsRuleList`) {
- // The window is already filled in so just replace contents.
- $justFill = 1;
- } else {
- $justFill = 0;
- }
-
- setParent $parent;
-
- // Scene segmenting
-
- if (!$justFill) {
- columnLayout -adj true $np_wsRuleList;
- frameLayout -borderVisible true -borderStyle "etchedIn"
- -collapsable true -collapse false
- -l "Scene File Locations" ("Defaults_F");
- columnLayout ("Objects_Defaults_L");
- }
-
- // Scene directories
-
- $listSize = size($objectWidgets);
- for ($index = 0; $index < $listSize; $index += 4)
- {
- string $label = $objectWidgets[$index];
- string $name = "np_ObjectLocation" + $objectWidgets[$index + 1];
- string $value = $objectWidgets[$index + 3];
-
- if (!$justFill)
- {
- textFieldGrp
- -editable $bEditable
- -label $label
- -fileName $value
- $name;
- }
- else
- {
- textFieldGrp -e
- -fileName $value
- $name;
- }
- }
-
- setParent $np_wsRuleList;
-
- // Rendering directories
-
- if (!$justFill) {
- frameLayout -borderVisible true -borderStyle "etchedIn"
- -collapsable true -collapse false
- -l "Project Data Locations"
- ("RenderLocations_Defaults_F");
- columnLayout ("RenderLocations_Defaults_L");
- }
-
- $listSize = size($renderWidgets);
- for ($index = 0; $index < $listSize; $index += 4)
- {
- string $label = $renderWidgets[$index];
- string $name = "np_RenderLocation" + $renderWidgets[$index + 1];
- string $value = $renderWidgets[$index + 3];
-
- if ($justFill) {
- textFieldGrp -e -fileName $value $name;
- } else {
- textFieldGrp -editable $bEditable -fileName $value -l $label $name;
- }
- }
-
- setParent $np_wsRuleList;
-
- // Data transfer directories
-
- if (!$justFill) {
- frameLayout -borderVisible true -borderStyle "etchedIn"
- -collapsable true -collapse false
- -l "Data Transfer Locations"
- ("DataTransferLocations_Defaults_F");
- columnLayout ("DataTransferLocations_Defaults_L");
- }
-
- $listSize = size($fileRuleWidgets);
- for ($index = 0; $index < $listSize; $index += 4)
- {
- string $label = $fileRuleWidgets[$index];
- string $name = "np_FileLocation" + $fileRuleWidgets[$index + 1];
- string $value = $fileRuleWidgets[$index + 3];
-
- if ($justFill) {
- textFieldGrp -e -fileName $value $name;
- } else {
- textFieldGrp -editable $bEditable -fileName $value -l $label $name;
- }
- }
- setParent $np_wsRuleList;
- }
-
- global proc int np_setNewLocation( string $path, string $type )
- {
- string $wsLocationCtl = ("wsLocation0");
-
- // All we do on a successful browse is set the control in the
- // 'New Project' window - if user accepts this choice all the
- // workspace stuff will be set up at that point
- if ( `textFieldButtonGrp -ex $wsLocationCtl` )
- {
- textFieldButtonGrp -e -fi $path $wsLocationCtl;
- return true;
- }
-
- // If we got here, then the user may have either accepted the
- // new project settings from the New Project window, or cancelled
- // the New Project window. In either case, the following should
- // be valid:
- string $wsDir = `workspace -q -fn`;
- if ( `file -q -ex $wsDir` )
- workspace -dir $wsDir;
-
- return false;
- }
-
- global proc np_browseForNewLocation()
- {
- string $wsDir;
- string $wsLocationCtl = ("wsLocation0");
-
- if ( `textFieldButtonGrp -ex $wsLocationCtl` )
- {
- $wsDir = `textFieldButtonGrp -q -fi $wsLocationCtl`;
- // Have to set the workspace dir so the fileBrowser knows
- // where to start looking
- if ( `file -q -ex $wsDir` )
- workspace -dir $wsDir;
- }
-
- fileBrowser "np_setNewLocation" "Select Location" "" 4;
- }
-
- global proc np_setupNewInfo ( )
- {
- string $parent = "wsSetupInfo";
-
- string $wsLocationCtl = ("wsLocation0");
- string $np_wsNameCtl = ("np_wsName0");
- string $wsScrollCtl = ("wsScroll0");
- int $enabled = 1;
-
- button -e -enable $enabled acceptSetup;
-
- if (!`textFieldButtonGrp -ex $np_wsNameCtl`) {
- string $currentDir = "";
- // Check for environment variable first
- $currentDir = getenv("MAYA_PROJECTS_DIR");
- if(size($currentDir) == 0) {
- // Environment var is not set, so check for option var now
- if(`optionVar -ex "ProjectsDir"`) {
- $currentDir = `optionVar -q "ProjectsDir"`;
- }
- if(size($currentDir) == 0) {
- // Option var is not set too. Get the root directory of the current workspace
- $currentDir = dirname( `workspace -q -fn` );
- }
- }
- setParent $parent;
- textFieldButtonGrp -editable $enabled
- -l "Name"
- -text "New_Project"
- -buttonLabel "Help... "
- -buttonCommand "showHelp NewProject"
- $np_wsNameCtl;
- textFieldButtonGrp -editable $enabled
- -l "Location"
- -fileName $currentDir
- -bl "Browse.."
- -bc np_browseForNewLocation $wsLocationCtl;
- scrollLayout -cr true $wsScrollCtl;
- np_showSetup ( "", $wsScrollCtl, 0, $enabled);
-
-
- formLayout -e
- -af $wsLocationCtl left 0
- -af $wsLocationCtl right 0
- -ac $wsLocationCtl top 0 $np_wsNameCtl
- -af $np_wsNameCtl left 0
- -af $np_wsNameCtl right 0
- -af $np_wsNameCtl top 5
- -af $wsScrollCtl left 0
- -af $wsScrollCtl right 0
- -af $wsScrollCtl bottom 0
- -ac $wsScrollCtl top 3 $wsLocationCtl
- $parent;
- }
- }
-
- global proc np_setupEditInfo ( )
- {
- string $parent = "wsSetupInfo";
-
- string $wsLocationCtl = ("wsLocation0");
- string $np_wsNameCtl = ("np_wsName0");
- string $wsScrollCtl = ("wsScroll0");
-
- button -e -enable 1 acceptSetup;
-
- if (!`textFieldGrp -ex $np_wsNameCtl`) {
- string $workspace = `workspace -q -fn`; // Get the current WS name.
- string $wsLocation = dirname( $workspace );
- string $wsName = basename( $workspace, "" );
-
- setParent $parent;
- textFieldButtonGrp -l "Name"
- -editable false
- -text $wsName
- -buttonLabel "Help... "
- -buttonCommand "showHelp EditProject"
- $np_wsNameCtl;
- textFieldGrp -l "Location"
- -editable false
- -fileName $wsLocation
- $wsLocationCtl;
-
- scrollLayout -cr true $wsScrollCtl;
- np_showSetup ( $workspace, $wsScrollCtl, 0, 1);
-
- formLayout -e
- -af $wsLocationCtl left 0
- -af $wsLocationCtl right 0
- -ac $wsLocationCtl top 0 $np_wsNameCtl
- -af $np_wsNameCtl left 0
- -af $np_wsNameCtl right 0
- -af $np_wsNameCtl top 5
- -af $wsScrollCtl left 0
- -af $wsScrollCtl right 0
- -af $wsScrollCtl bottom 0
- -ac $wsScrollCtl top 3 $wsLocationCtl
- $parent;
- }
- }
-
-
- global proc string np_displayWSSetup ( string $parent, int $mode )
- //
- // Parameters:
- // $parent - the parent control layout.
- // $mode - 1 == new project
- // 2 == edit project.
- //
- {
- setParent $parent;
-
- string $callback;
-
- if ($mode == 1) {
- $callback = "if (np_createNewProjectCallback()) deleteUI newProjectWindow;";
- } else if ($mode == 2) {
- $callback = "np_editProjectCallback;deleteUI newProjectWindow";
- }
-
- int $numDivisions = 100;
- formLayout -nd $numDivisions WSsetupForm;
- formLayout setupControlArea;
- button -l "Accept" -width 110 -c $callback acceptSetup;
- if ($mode == 1) {
- button -l "Use Defaults" -width 110 -c "np_resetDefaults" defaultSetup;
- }
- button -l "Cancel" -width 110 -c "deleteUI newProjectWindow;" cancelSetup;
-
- formLayout -e
- -af acceptSetup "left" 5
- -af acceptSetup "bottom" 5
- -an acceptSetup "top"
- -af cancelSetup "bottom" 5
- -af cancelSetup "right" 5
- -an cancelSetup "top"
- setupControlArea;
-
- // Only have the "Use Defaults" button in "new" mode since the
- // user shouldn't be making radical changes to a created project.
- //
- if ($mode == 1) {
- formLayout -e
- -ap acceptSetup "right" 0 33
- -af defaultSetup top 0
- -ac defaultSetup left 5 acceptSetup
- -ap defaultSetup right 0 66
- -af defaultSetup bottom 5
- -ac cancelSetup "left" 5 defaultSetup
- setupControlArea;
- } else {
- formLayout -e
- -ap acceptSetup "right" 3 50
- -ac cancelSetup "left" 5 acceptSetup
- setupControlArea;
- }
-
-
- setParent WSsetupForm;
-
- formLayout wsSetupInfo;
-
- formLayout -e -af wsSetupInfo top 0 -af wsSetupInfo left 0
- -af wsSetupInfo right 0
- -ac wsSetupInfo bottom 5 setupControlArea
- -af setupControlArea left 0 -af setupControlArea right 0
- -af setupControlArea bottom 0
- -an setupControlArea top
- WSsetupForm;
-
- if ($mode == 1) {
- np_setupNewInfo; // Draw the first tab.
- } if ($mode == 2) {
- np_setupEditInfo;
- }
-
- return "WSsetupForm";
- }
-
- global proc projectSetup ( int $mode )
- //
- // Description:
- // Edit a new project if $mode = 2.
- // Display a new project setup window if $mode = 1.
- // Display the defaults if $mode = 0. - defunct
- //
- {
- global string $gProjectSetupWorkspace;
-
- if (!`window -ex newProjectWindow`) {
- window -iconName "Project" -wh 450 510 newProjectWindow;
- tabLayout -tv false windowLayout;
- columnLayout dummyTab;
- } else {
- // remove the children
- string $childList[] = `tabLayout -q -ca windowLayout`;
- int $numChildren = size($childList);
- int $child;
-
- for ($child = 0; $child < $numChildren; $child++) {
- deleteUI $childList[$child];
- }
-
- setParent windowLayout;
- columnLayout dummyTab; // Make the dummy display tab.
- }
-
- if ($mode == 2) {
- // remember the current workspace (we need it for editing)
- //
- $gProjectSetupWorkspace = `workspace -query -fullName`;
- window -e -t "Edit Project" newProjectWindow;
- tabLayout -e -st dummyTab windowLayout;
- string $newTab = `np_displayWSSetup windowLayout $mode`;
- tabLayout -e -st $newTab windowLayout;
- } else if ($mode == 1) {
- // set the "current" workspace to nothing since there is none
- //
- $gProjectSetupWorkspace = "";
- window -e -t "New Project" newProjectWindow;
- tabLayout -e -st dummyTab windowLayout;
- string $newTab = `np_displayWSSetup windowLayout $mode`;
- tabLayout -e -st $newTab windowLayout;
- }
-
- showWindow newProjectWindow;
- }
-